//
//  iCoreGUIController.h
//  TestFistGame
//
//  Created by  on 5/17/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"
#import "GameCenterHelper.h"
#import "GameLayer.h"
#import "IntroScreen.h"
#import "PlayScreen.h"
#import "MainMenuScreen.h"
#import "LoadingScreen.h"
#import "MapScreen.h"
#import "Define.h"
#import "Sound.h"
#import "DataAccess.h"
#import "PlayerData.h"
#import "PauseGameScreen.h"
#import "GameOverScreen.h"
#import "VictoryScreen.h"
#import "GameResourceDefine.h"
#import "RegisterUserScreen.h"

enum {
    GAME_SCREEN_INTRO,
    GAME_SCREEN_MAIN_MENU,
    GAME_SCREEN_SELECT_MAP,
    GAME_SCREEN_PLAY
};

enum {
    TAG_LOADING_SCREEN = 0,
    TAG_PAUSE_SCREEN = 1
};

@interface iCoreGUIController : NSObject {
    CCDirector *mainDirector;
    DataAccess *dataAccess;
    
    PlayerData *playerData;
    
    Sound *soundPlayer;
    //TRUE if mute all sound player
    BOOL isMuteSound;
    
    BOOL isPausingGame;
    
    NSArray *listMap;
    int currentMapRunning;
}

@property (retain, nonatomic) CCDirector *mainDirector;
@property (retain, nonatomic) DataAccess *dataAccess;
@property (retain, nonatomic) PlayerData *playerData;
@property (nonatomic) BOOL isMuteSound;
@property (nonatomic) BOOL isPausingGame;
@property (retain, nonatomic) NSArray *listMap;
@property (nonatomic) int currentMapRunning;

-(id)initiCoreGUIControllerWithDirector:(CCDirector *)_director;
-(void)startUp;

-(void)runWithGameLayer:(GameLayer *)_gameLayer;
-(void)runGameScreen:(int)_gameScreenEnum;

-(void)startLoading:(int)_gameScreenEnum plistSpriteArr:(NSMutableArray *)_plistSpriteArr;

-(void)loadGraphicFromPNGToFrameCache:(NSString *)_pngFileName withRowCount:(int)_rowCount withColumnCount:(int)_columnCount;
-(void)loadGraphicFromPlistFileToFrameCache:(NSString *)_plistFile;
-(NSMutableArray*)loadAnimationWithNumberOfFrames:(int) numberOfFrames withFrameName:(NSString*)frame;
-(CCAnimation *)loadAnimationFromCacheByName:(NSString *)_name withCount:(int)_frameCount delay:(float)_delay;
-(BOOL)removeAnimationInFrameCache:(NSString *)_frameCacheName;

-(void)loadPlayerData;

-(void)pauseGameWithCurrentLayer:(GameLayer *)_currentLayer;
-(void)resumeGame:(GameLayer *)_pauseGameScreen;

-(void)cleanupFrameCacheSprite;

-(void)connectGameCenter;

-(void)preloadSoundEffectFile:(NSString *)_fileName;
-(void)unloadSoundEffectFile:(NSString *)_fileName;
-(void)playEffect:(NSString *)_fileName;
-(void)setEffectSoundVolume:(float)_value;
-(void)playBackgroundSound:(NSString *)_fileName withLoop:(BOOL)_isLoop;
-(void)stopBackgroundSound;
-(void)setBackgroundSoundVolume:(float)_value;
-(void)setMuteSoundPlayer:(BOOL)_muteValue;

@end
